package com.example.salesystem.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author lishuo
 * @since 2024-05-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("orders")
@ApiModel(value="Order对象", description="")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID，主键自增")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户ID，关联用户表")
    private Long userId;

    @ApiModelProperty(value = "商品ID，关联商品表")
    private Long productId;

    @ApiModelProperty(value = "订单金额")
    private Double orderAmount;

    @ApiModelProperty(value = "商品数量")
    private Integer productQuantity;

    @ApiModelProperty(value = "订单状态 ,  0:待付款, 1已付款")
    private Integer orderStatus;

    @ApiModelProperty(value = "创建时间，精确到秒")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间，精确到秒")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "是否已删除，0否，1是")
    private Integer isDeleted;

    @ApiModelProperty(value = "商品详情")
    @TableField(exist = false)
    private Product product;
}
